package com.heliang.protocol.service;

import java.io.IOException;

import org.json.JSONException;

import com.heliang.common.Http;
import com.heliang.protocol.baseBean.ReqBodyBaseBean;
import com.heliang.protocol.baseBean.RspBodyBaseBean;

public class ProtocolBase {
	/**
	 * 网络请求处理
	 * @param reqBodyBaseBean
	 * @param url //接口地址
	 * @return
	 * @throws IOException
	 * @throws JSONException
	 */
	public static RspBodyBaseBean dataProcess(ReqBodyBaseBean reqBodyBaseBean,
			String url) throws IOException, JSONException {
		RspBodyBaseBean rspBodyBaseBean = new RspBodyBaseBean();
		return rspBodyBaseBean;
	}
	
	/**
	 * 发送网络请求
	 * @param url
	 * @return
	 * @throws IOException
	 */
	public static String getDataByReqServer(String url) throws IOException {
		
		byte[] rspData = Http.getWebContentByGet(
				url);
		if (rspData != null) {
			return new String(rspData,"UTF-8");
		}
		return "";
	}
}
